/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package dawnland02.model.action.controller;

import dawnland02.model.action.ActionFactory;
import dawnland02.model.entity.EntityInternal;
import dawnland02.model.task.Task;
import dawnland02.service.GeneralService;

/**
 * @author Petru Obreja (obrejap@yahoo.com)
 */
public class BuildRoadActionController extends AbstractActionController{
    public BuildRoadActionController(EntityInternal entity, Task task) {
        super(entity, task);
        init();
    }

    @Override
    public void init() {
        action = ActionFactory.createBuildRoadAction();
        action.setActionController(this);
        initialized = true;
    }

    @Override
    public void act() {
        switch(action.getCurrentStep()){
            case ACTION_BEFORE_START:{
                break;
            }
            case ACTION_INTERMEDIATE: {
                break;
            }
            case ACTION_AFTER_END: {
                entity.getMatrixCell().increaseRoadLevel();
                this.end();
                break;
            }
        }
    }

}
